﻿using System.Net.Mail;
using System.Text;

namespace Cms.Utilities
{
    public static class Mail
    {
        public static void SendText(string from, string to, string subject, string body)
        {
            var message = new MailMessage
                              {
                                  From = new MailAddress(from),
                                  IsBodyHtml = false,
                                  Subject = subject,
                                  BodyEncoding = Encoding.UTF8,
                                  Body = body
                              };
            message.To.Add(new MailAddress(to));
            var server = new SmtpClient();
            server.Send(message);
        }
    }
}